﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Win104.IEC104
{
    public class EAbstractQuality : InformationElement
    {
        protected int value;
        public EAbstractQuality(ByteBody data)
        {
            value = data.GetByte() & 0xFF;
        }
        public override int Encode(byte[] buffer, int i)
        {
            buffer[i] = (byte)value;
            return 1;
        }

        /// <summary>
        /// 是否有效
        /// </summary>
        /// <returns></returns>
        public int IsInvalid()
        {
            return (value >> 7) & 0x01;
        }
    }
}
